package com.skyable.account.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.skyable.account.entity.SysPermission;
import com.skyable.common.common.ServiceResult;

import java.util.List;

/**
 * @author GaoYuan
 * @title: IPermissionService
 * @projectName spring-cloud-demo
 * @description: TODO
 * @date 2021/4/613:08
 */
public interface IPermissionService extends IService<SysPermission> {

    /**
     * 新增权限
     * @param sysPermission
     * @return
     */
    ServiceResult<SysPermission> insertPermission(SysPermission sysPermission);

    /**
     * 更新权限
     * @param sysPermission
     * @return
     */
    ServiceResult<SysPermission> updatePermission(SysPermission sysPermission);

    /**
     * 分页获取权限列表
     * @param page
     * @param limit
     * @param sysPermission
     * @return
     */
    ServiceResult<IPage<SysPermission>> findPermissionListByPage(int page, int limit, SysPermission sysPermission);

    /**
     * 获取权限列表
     * @return
     */
    ServiceResult<List<SysPermission>> findPermissionList();

    /**
     * 根据用户名查询用户权限
     * @param userName
     * @return
     */
    ServiceResult<List<SysPermission>> findPermissionByUserName(String userName);

    /**
     * 根据ID查询权限信息
     * @param permissionId
     * @return
     */
    ServiceResult<SysPermission> findPermissionById(Long permissionId);

    /**
     * 删除权限
     * @param permissionId
     * @return
     */
    ServiceResult<Integer> deletePermissionById(Long permissionId);
}
